package com.zhousb.deviceManager.controller;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zhousb.deviceManager.common.PageRequest;
import com.zhousb.deviceManager.common.R;
import com.zhousb.deviceManager.common.ResponseResult;
import com.zhousb.deviceManager.model.so.NoticeSo;
import com.zhousb.deviceManager.model.so.ProductSo;
import com.zhousb.deviceManager.model.so.SimpleSo;
import com.zhousb.deviceManager.service.NoticeService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.*;

/**
 * @author ZhouShenBin
 * @date 2024/7/11 10:36
 * @description
 */
@RestController
@RequestMapping("/notice")
@Tag(name = "消息通知")
public class NoticeController {

    @Resource
    private NoticeService noticeService;

    @PostMapping("/list")
    @Operation(summary = "消息列表")
    public ResponseResult list() {
        return R.success(noticeService.list());
    }

    @GetMapping("/read")
    @Operation(summary = "消息列表")
    public ResponseResult read(@RequestParam("id")String id) {
        return R.success(noticeService.read(id));
    }

    @GetMapping("/readAll")
    @Operation(summary = "已读全部")
    public ResponseResult readAll() {
        return R.success(noticeService.readAll());
    }

}
